package com.typ.member.common.model;

/**
 * @author heran
 * @version 1.0, 2019-05-13 20:31
 */
public class ResponseUtil {

    public static <T> Response<T> createSuccess() {
        Response<T> response = new Response<>();
        response.setIsSuccess(Boolean.TRUE);
        response.setCode(20000);
        return response;

    }

    public static <T> Response<T> createSuccess(T data) {
        Response<T> response = new Response<>();
        response.setIsSuccess(Boolean.TRUE);
        response.setData(data);
        response.setCode(20000);
        return response;
    }

    public static <T> Response<T> createError(String message) {
        Response<T> response = new Response<>();
        response.setIsSuccess(Boolean.FALSE);
        response.setMessage(message);
        response.setCode(20000);
        return response;
    }
}
